@using Microsoft.AspNetCore.Html;
@{
	IReadOnlyList<IDocument> parameters = Model.List<IDocument>("Parameters");
	IReadOnlyList<ReferenceComment> paramComments = Model.List<ReferenceComment>("Params");
}
@if(parameters != null && parameters.Count > 0)
{
	<h1 id="Parameters">Parameters</h1>
	<div class="box">
		<div class="box-body no-padding table-responsive">
			<table class="table table-striped table-hover three-cols">
				<thead>
					<tr>
						<th>Name</th>
						<th>Type</th>
						<th>Description</th>
					</tr>
				</thead>
				@foreach(IDocument parameter in parameters)
				{
					IDocument parameterType = parameter.Get<IDocument>("Type");
					<tr>
						<td>@parameter["Name"]</td>
						<td>@(parameterType == null ? new HtmlString(string.Empty) : Context.GetTypeLink(parameterType))</td>
						<td>@Html.Raw(paramComments?.Where(x => x.Name.Equals(parameter["Name"])).Select(x => x.Html).FirstOrDefault())</td>
					</tr>
				}
			</table>
		</div>
	</div>	
}